<template>
    <el-main>
        <el-main class="ep-body">
            <epl-top-bar :datas="{formData:form}" showPerson psTagType="PERSON_PENSION_QUERY" personType="PERSON_ALL_EXACT">
                <!--<ep-saveButton id=""  type="primary"-->
                               <!--:datas="{formData: form,panel:panel}"></ep-saveButton>-->
                <!--<ep-button id="" api="doAudit"  type="primary"-->
                           <!--:datas="{formData: form,panel:panel}"-->
                           <!--name="审核"></ep-button>-->
            </epl-top-bar>
            <epl-userMessage dataType="person" idCount = "1">
            </epl-userMessage>
            <el-card class="ep-card">
                <ep-title>资格认证信息</ep-title>
                <el-form :model="form" :rules="rules">
                    <el-row :gutter="10">
                        <ep-select colspan="8" label="特殊工种类型" name="aac019" placeholder="请选择特殊工种类型" :property="form.aac019" codetype="AAC019"
                                   p="R"  :datas="{formData:form}"></ep-select>
                        <ep-number colspan="8" label="累计从事年限" name="bae201" :property="form.bae201"
                                   p="R"  :datas="{formData:form}"></ep-number>
                        <ep-select colspan="8" label="海拔" name="bic128" placeholder="请选择海拔" :property="form.bic128" codetype="BIC128"
                                   p="E"  :datas="{formData:form}"></ep-select>
                    </el-row>
                    <el-row :gutter="10">
                        <ep-select colspan="8" placeholder="请选择97年底从事年限" label="97年底前从事年限" name="bic129" :property="form.bic129" codetype="BIC129"
                                   p="E"  :datas="{formData:form}"></ep-select>
                    </el-row>

                    <el-row type="flex" justify="center">
                        <ep-saveButton id=""  type="primary"
                            :datas="{formData: form,panel:panel}"></ep-saveButton>
                 </el-row>
             </el-form>
         </el-card>
     </el-main>
 </el-main>
</template>
<script type="es6">
 export default {
     data() {
         return {
             show: false,
             form: {
                 aac019:{
                     p:"R",
                     value:'',
                     key:''
                 },
                 bae201:{
                     p:"R",
                     value:'',
                 },
                 bic128:{
                     p:"E",
                     value:'',
                     key:''
                 },
                 bic129:{
                     p:"E",
                     value:'',
                     key:''
                 }
             },
             codeTypes: {
                 AAC019: [],
                 BIC128: [],
                 BIC129:[]
             },
             rules: {
                 aac019: [{
                     required: true
                 }],
                 bae201: [{
                     required: true
                 }]
             },
             panel: {}
         }
     },
     computed: {
         init_form() {
             return this.$store.getters.init.form;
         },
         doInit: {
             get: function () {
                 if (this.$store.getters.common === null) return [];
                 return this.$store.getters.common.formData;
             },
             set: function (value) {
                 return value;
             }
         },
         doPanel: {
             get: function () {
                 if (this.$store.getters.common === null) return {};
                 return this.$store.getters.common.panel;
             },
             set: function (newValue) {
                 return newValue;
             }
         }
     },
     watch: {
         init_form: {
             handler(value) {
                 this.getInitform(value);
             },
             deep: true
         },
         doInit: {
             handler(value) {
                 this.getInitform(value);
             },
             deep: true
         },
         doPanel: {
             handler(value) {
                 if (value == undefined) return;
                 this.getPanel(value);
             },
             deep: true
         }
     },
     mounted() {
         let param = {
             codeTypes: this.codeTypes,
             form: this.form,
         };
         this.$store.dispatch('SET_INIT', param);
     },
     methods: {
         getPanel(value) {
             this.panel = value;
         },
         handleSizeChange(val) {
             console.log(`每页 ${val} 条`);

         },
         handleCurrentChange(val) {
             console.log(`当前页: ${val}`);
         },
         /**
          * 获取初始
          */
         getInitform(value) {
             if(value === undefined) return
             // console.log('value',value);
             this.form = value;
         },
         handleEdit(id) {
             this.dialogFormVisible = true;
         },
         handleChange(val) {
             console.log(val)
         }
     }
 }
</script>
